/**
 * Created by henian.xu on 2018/11/5.
 *
 */
const nuxtConfig = require('./config.nuxt');

module.exports = appInfo => {
    const config = (exports = {});

    config.cluster = {
        listen: {
            path: '',
            port: 7001,
            hostname: '0.0.0.0',
        },
    };

    config.security = {
        csrf: {enable: false},
    };

    // use for cookie sign key, should change to your own and keep security
    config.keys = appInfo.name + '_1536244824491_1824_xuhenian';

    // 中间件
    config.middleware = ['nuxtRender'];

    // 模板引擎
    config.view = {
        defaultViewEngine: 'nunjucks',
        mapping: {
            '.tpl': 'nunjucks',
        },
    };

    // 添加 news 的配置项
    config.news = {
        pageSize: 5,
        serverUrl: 'https://hacker-news.firebaseio.com/v0',
    };

    // api 配置
    config.javaServer = {
        url: 'http://admin.pubaihui.xinchidao.com', // 普百汇
    };

    // nuxt 配置
    config.nuxt = nuxtConfig;

    return config;
};
